#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>

//https://www.luogu.com.cn/problem/P4549
using namespace std;
int n;
int x;

int gcd(int a, int b)
{
	if (a < b)swap(a, b);
	return b == 0 ? a : gcd(b, a % b);
}

int main()
{
	int ret = 0;

	cin >> n;
	cin >> ret;
	ret = abs(ret);

	for (int i = 2; i <= n; ++i)
	{
		cin >> x;
		ret = gcd(ret, abs(x));
	}
	cout << ret << endl;


	return 0;
}